<template>
  <div>
    <remote-script src="javascript/flow/traceobjectclass.js"></remote-script>
    <remote-script src="javascript/flow/trace.js"></remote-script>
    <remote-script src="javascript/flow/raphael-min.js"></remote-script>
    <remote-script src="javascript/flow/tracepathcontrol.js"></remote-script>
    <remote-script src="javascript/flow/json3.js"></remote-script>
    <el-menu default-active='active' mode='horizontal' class='menu-unit'>
      <el-menu-item v-for='item in Container1' :index="'流程图'===item.name?'active':'default'">
        <el-link @click="gotoMenu(item.url)" :type="'流程图'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
      </el-menu-item>
    </el-menu>
    <table cellpadding="4" cellspacing="0" border="0" width="100%">
      <tr>
        <td class="containerBack">
          <div class="big-title">
            <span class="big-title-left">
              <span>{{plan_name}}</span>
            </span>
          </div>
          <el-form ref="form" :rules="rules" label-width="100px">
            <input id=functionName type=hidden name=functionName>
            <input id=pathInfo type=hidden value='' name=pathInfo>
            <input id=mainTableName type=hidden name=mainTableName>
            <input id=listTableName type=hidden name=listTableName>
          </el-form>
          <div id="svg"></div>
          <div id=altMsg scrolling="no" style="border:1px solid #000000 ;position: absolute; background-color: #FFFAE9; z-index: 200; font-size: 10pt; display: none"></div>
          <div id=oPopupMenu scrolling="no" style="position: absolute; z-index: 200; display: none"></div>
        </td>
      </tr>
    </table>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'DetectionFlow',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        loading: false,
        Container1: null,
        rules: {}
      }
    },
    created() {
      this.getData();
      this.loadContainerMenu({
        pid: "C1BDE411EFF7473EAF5F658AF81F2689",
        name: "工序流程图",
        selected: "流程图"
      }, 'Container1', this.vueparams);
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/product/ProductAction/detectionFlow?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
          window.m_bView = false;
          this.mvc.flowLoad(this.steps, this.skips);
          flowLoad();
        })
      },
      detectionFlowSubmit(_params) {
        this.$data.pathInfo = submitString("SAVE");
        request({
          method: 'post',
          url: '/xcapi/VUEAction/psi/product/ProductAction/detectionFlowSubmit?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
      d_plan_step(_params) {
        this.$data.pathInfo = submitString("SAVE");
        request({
          method: 'post',
          url: '/xcapi/VUEAction/psi/product/ProductAction/d_plan_step?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
    },
  }
</script>
